<?php

namespace App\Models\Order;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    use HasFactory;
    protected $table = 'orders_full';

    private $statusMap = [
        1 => '审核失败', 2 => '待上传照片', 3 => '待提交审核',4 => '待系统审核',
        5 => '待人工审核',6 => '待开卡',7 => '已领取',8 => '开卡中',9 => '待发货',
        10 => '已发货',11 => '已完成',12 => '订单取消',13 => '开卡失败',
    ];

    protected $appends = ['status_text'];

    // 定义访问器，动态生成 status_text
    public function getStatusTextAttribute()
    {
        return $this->statusMap[$this->status] ?? '未知状态';
    }
}
